# 随便写什么
import random

def guess_number():
    number = random.randint(1, 100)
    while True:
        try:
            guess = int(input("猜一个1到100之间的数字: "))
            if guess == number:
                print("恭喜你，猜对了！")
                break
            elif guess < number:
                print("太小了，再试试！")
            else:
                print("太大了，再试试！")
        except ValueError:
            print("请输入一个有效的数字！")

if __name__ == "__main__":
    guess_number()